package cn.com.lyb.workflow.entity;

import cn.com.lyb.workflow.entity.dto.ConditionResultDTO;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 工作流节点任务表
 * </p>
 *
 * @author lvyuanbo
 * @since 2024-07-22
 */
@TableName("workflow_job")
@ApiModel(value="WorkflowJobDO对象", description="工作流节点任务表")
public class WorkflowJobDO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "唯一编码")
    private Long code;

    @ApiModelProperty(value = "工作流id")
    private Long workflowId;

    @ApiModelProperty(value = "job_id，逻辑节点该值为空")
    private Long jobId;

    @ApiModelProperty(value = "节点名称")
    private String jobName;

    @ApiModelProperty(value = "逻辑节点的子数据")
    private ConditionResultDTO conditionResult;

    @ApiModelProperty(value = "任务类型：1.sql 2. http 3. 逻辑节点")
    private String type;

    private String del;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getCode() {
        return code;
    }

    public void setCode(Long code) {
        this.code = code;
    }

    public Long getWorkflowId() {
        return workflowId;
    }

    public void setWorkflowId(Long workflowId) {
        this.workflowId = workflowId;
    }

    public Long getJobId() {
        return jobId;
    }

    public void setJobId(Long jobId) {
        this.jobId = jobId;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public ConditionResultDTO getConditionResult() {
        return conditionResult;
    }

    public void setConditionResult(ConditionResultDTO conditionResult) {
        this.conditionResult = conditionResult;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDel() {
        return del;
    }

    public void setDel(String del) {
        this.del = del;
    }

    @Override
    public String toString() {
       return JSONUtil.toJsonStr(this);
    }
}
